16x12r 2.2.0
Loading...
Searching...
No Matches
16x12r


16x12 R Click

16x12 R Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Stefan Filipovic
  • Date : Jun 2025.
  • Type : I2C type

Software Support

Example Description

This example demonstrates the usage of the 16x12 R Click board which features a high-brightness red LED matrix display. It displays characters, rotates them in different orientations, prints a scrolling string, and renders a graphical image (MIKROE logo).

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.16x12R

Example Key Functions

  • c16x12r_cfg_setup This function initializes Click configuration structure to initial values.
    void c16x12r_cfg_setup(c16x12r_cfg_t *cfg)
    16x12 R configuration object setup function.
    16x12 R Click configuration object.
    Definition c16x12r.h:267
  • c16x12r_init This function initializes all necessary pins and peripherals used for this Click board.
    err_t c16x12r_init ( c16x12r_t *ctx, c16x12r_cfg_t *cfg );
    err_t c16x12r_init(c16x12r_t *ctx, c16x12r_cfg_t *cfg)
    16x12 R initialization function.
    16x12 R Click context object.
    Definition c16x12r.h:242
  • c16x12r_default_cfg This function executes a default configuration of 16x12 R Click board.
    err_t c16x12r_default_cfg(c16x12r_t *ctx)
    16x12 R default configuration function.
  • c16x12r_write_char This function writes a single ASCII character to the display.
    err_t c16x12r_write_char ( c16x12r_t *ctx, uint8_t data_in );
    err_t c16x12r_write_char(c16x12r_t *ctx, uint8_t data_in)
    16x12 R write character function.
  • c16x12r_write_string This function scrolls a null-terminated ASCII string across the display.
    err_t c16x12r_write_string ( c16x12r_t *ctx, uint8_t *data_in, uint16_t speed_ms );
    err_t c16x12r_write_string(c16x12r_t *ctx, uint8_t *data_in, uint16_t speed_ms)
    16x12 R write string function.
  • c16x12r_draw_picture This function draws a picture on the display from a 12-column buffer.
    err_t c16x12r_draw_picture ( c16x12r_t *ctx, const uint16_t *image );
    err_t c16x12r_draw_picture(c16x12r_t *ctx, const uint16_t *image)
    16x12 R draw picture function.

Application Init

Initializes the logger and the Click board and sets the default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
c16x12r_cfg_t c16x12r_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
c16x12r_cfg_setup( &c16x12r_cfg );
C16X12R_MAP_MIKROBUS( c16x12r_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == c16x12r_init( &c16x12r, &c16x12r_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( C16X12R_ERROR == c16x12r_default_cfg ( &c16x12r ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
@ C16X12R_ERROR
Definition c16x12r.h:287
#define C16X12R_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition c16x12r.h:227
void application_init(void)
Definition main.c:31

Application Task

Displays single characters and a string in multiple rotations, followed by drawing and inverting the MIKROE logo image.

void application_task ( void )
{
log_printf( &logger, " Writing digits\r\n\n" );
c16x12r.text_rotation = C16X12R_ROTATION_H_0;
for ( uint8_t digit = '0'; digit <= '9'; digit++ )
{
c16x12r_write_char ( &c16x12r, digit );
Delay_ms ( 500 );
}
log_printf( &logger, " Rotating char\r\n\n" );
c16x12r.text_rotation = C16X12R_ROTATION_H_0;
c16x12r_write_char ( &c16x12r, 'R' );
Delay_ms ( 500 );
c16x12r.text_rotation = C16X12R_ROTATION_H_180;
c16x12r_write_char ( &c16x12r, 'R' );
Delay_ms ( 500 );
c16x12r.text_rotation = C16X12R_ROTATION_V_0;
c16x12r_write_char ( &c16x12r, 'R' );
Delay_ms ( 500 );
c16x12r.text_rotation = C16X12R_ROTATION_V_180;
c16x12r_write_char ( &c16x12r, 'R' );
Delay_ms ( 500 );
c16x12r.text_rotation = C16X12R_ROTATION_H_0;
c16x12r_write_char ( &c16x12r, 'R' );
Delay_ms ( 500 );
log_printf( &logger, " Writing text\r\n\n" );
c16x12r.text_rotation = C16X12R_ROTATION_H_0;
c16x12r_write_string ( &c16x12r, "MIKROE - 16x12 R Click", 50 );
Delay_ms ( 1000 );
log_printf( &logger, " Writing text\r\n\n" );
c16x12r.text_rotation = C16X12R_ROTATION_H_180;
c16x12r_write_string ( &c16x12r, "MIKROE - 16x12 R Click", 50 );
Delay_ms ( 1000 );
log_printf( &logger, " Writing text\r\n\n" );
c16x12r.text_rotation = C16X12R_ROTATION_V_0;
c16x12r_write_string ( &c16x12r, "MIKROE - 16x12 R Click", 50 );
Delay_ms ( 1000 );
log_printf( &logger, " Writing text\r\n\n" );
c16x12r.text_rotation = C16X12R_ROTATION_V_180;
c16x12r_write_string ( &c16x12r, "MIKROE - 16x12 R Click", 50 );
Delay_ms ( 1000 );
log_printf( &logger, " Drawing MIKROE logo\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " Drawing inverted MIKROE logo\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
const uint16_t c16x12r_img_mikroe[]
Memory buffers for 16x12 R Click.
const uint16_t c16x12r_img_mikroe_inv[]
#define C16X12R_ROTATION_V_0
16x12 R text ASCII byte rotation.
Definition c16x12r.h:196
#define C16X12R_ROTATION_H_0
Definition c16x12r.h:198
#define C16X12R_ROTATION_V_180
Definition c16x12r.h:197
#define C16X12R_ROTATION_H_180
Definition c16x12r.h:199
void application_task(void)
Definition main.c:67

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.